package com.example.demo.service;

import com.example.demo.dao.ArticleMapper;
import com.example.demo.model.Articleinfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:  不是在摸鱼的组装层service!!
 * User: yyx
 * Date: 2023-11-05
 * Time: 14:41
 */
@Service
public class ArticleService {

    @Autowired
    private ArticleMapper articleMapper;

    public List<Articleinfo> getArtByUid(int uid){
        return articleMapper.getArtByUid(uid);
    }

    public int del(Integer aid,int uid){
        return articleMapper.del(aid,uid);
    }

    public int add(Articleinfo articleinfo){
        return articleMapper.add(articleinfo);
    }

    public Articleinfo getArtByidANDuid(int aid,int uid){
        return articleMapper.getArtByidAnduid(aid,uid);
    }

    public int update(Articleinfo articleinfo){
        return articleMapper.update(articleinfo);
    }

    public Articleinfo getDetailByid(int aid){
        return articleMapper.getDetailByid(aid);
    }

    public int getArtCountByUid(int uid){
        return articleMapper.getArtCountByUid(uid);
    }

    public int increment(int aid){
        return articleMapper.increment(aid);
    }


    public List<Articleinfo> getListByPage(int psize,int offset){
        return articleMapper.getListByPage(psize,offset);
    }

    public int getArtCount(){
        return articleMapper.getArtCount();
    }

}
